<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件
if (!function_exists('sendMsgToUser')) {
    /**
     * @title 给用户发送一条消息
     * @description 给用户发送一条消息
     * @author Admin ldy
     * @param name:$uid  type:string require:1 default:1 desc:
     * @param name:$title  type:string require:1 default:1 desc:
     * @param name:$content  type:string require:1 default:1 desc:
     * @time 2018/9/21  15:17
     * @return \app\common\library\ReFail|\app\common\library\ReSuccess
     */
    function sendMsgToUser($uid,$title,$content)
    {
        return \app\common\library\YuActivity::sendInnerMsgToUserInBackGround($uid,$title,$content);
    }
}

if (!function_exists('sendMsgToUserByEmail')) {
    /**
     * @title 给用户发送一条消息
     * @description 给用户发送一条消息
     * @author Admin ldy
     * @param name:$email  type:string require:1 default:1 desc:
     * @param name:$title  type:string require:1 default:1 desc:
     * @param name:$content  type:string require:1 default:1 desc:
     * @time 2018/9/21  15:17
     * @return \app\common\library\ReFail|\app\common\library\ReSuccess
     */
    function sendMsgToUserByEmail($email,$title,$content)
    {
        return \app\common\library\YuActivity::sendInnerMsgToUserInBackGroundByEmail($email,$title,$content);
    }
}

if (!function_exists('sendEmailByUid')) {
    /**
     * @title 给用户发送一条邮件消息
     * @description 给用户发送一条邮件消息
     * @author Admin ldy
     * @param name:$uid  type:string require:1 default:1 desc:
     * @param name:$title  type:string require:1 default:1 desc:
     * @param name:$content  type:string require:1 default:1 desc:
     * @time 2018/9/21  15:17
     * @return \app\common\library\ReFail|\app\common\library\ReSuccess
     */
    function sendEmailByUid($uid,$title,$content)
    {
        return \app\common\library\YuActivity::sendEmailToUserInBackGroundByUserId($uid,$title,$content);
    }
}


if (!function_exists('sendScoreTo')) {
    /**
     * @title 给用户发送积分
     * @description 给用户发送积分
     * @author Admin ldy
     * @param name:$uid  type:string require:1 default:1 desc:
     * @param name:$score  type:string require:1 default:1 desc:
     * @time 2018/9/21  15:17
     * @return \app\common\library\ReFail|\app\common\library\ReSuccess
     */
    function sendScoreTo($uid,$score)
    {
        return  \app\common\library\YuActivity::sendScoreToUserInBackGround($uid,$score);
    }
}

if (!function_exists('sendExpTo')) {
    /**
     * @title 给用户发送经验值
     * @description 给用户发送经验值
     * @author Admin ldy
     * @param name:$uid  type:string require:1 default:1 desc:
     * @param name:$Exp  type:string require:1 default:1 desc:
     * @time 2018/9/21  15:17
     * @return \app\common\library\ReFail|\app\common\library\ReSuccess
     */
    function sendExpTo($uid,$Exp)
    {
        return \app\common\library\YuActivity::sendExperienceToUserInBackGround($uid,$Exp);
    }
}

if (!function_exists('rewardNormal')) {
    /**
     * @title 给用户发送随机的奖励
     * @description 给用户发送随机的奖励
     * @author Admin ldy
     * @param name:$uid  type:string require:1 default:1 desc:
     * @param name:$title  type:string require:1 default:1 desc: 消息名称，例如：  更新【'.$key.'】成功！
     * @time 2018/11/1  18:15
     * @return \app\common\library\ReFail|\app\common\library\ReSuccess
     */
    function rewardNormal($uid,$title){
        return \app\common\library\YuActivity::rewardNormal($uid,$title);
    }
}